import static org.junit.Assert.assertTrue;

import org.junit.Test;

public class BubbleSortTest {
	public int[] arr;

	@Test
	public void testSort() {
		arr = new int[] { 1, 6, 2, 2, 5 };
		arr = BubbleSort.BubbleSort(arr);
		int[] expected = { 1, 2, 2, 5, 6 };
		assertTrue(arrayEqual(expected, arr));
	}

	public boolean arrayEqual(int[] a, int[] b) {
		if (a.length != b.length) {
			return false;
		} else {
			for (int i = 0; i < a.length; ++i) {
				if (a[i] != b[i]) {
					return false;
				}
			}
		}
		return true;
	}
}
